package mysql

import "gorm.io/gorm"

type Doctor struct {
	gorm.Model
	DoctorCode string `gorm:"Type:varchar(30);not null;comment:工号"`
	Password   string `gorm:"Type:varchar(32);not null;comment:密码"`
}

func (d *Doctor) FindDoctorByCode(db *gorm.DB, code string) error {
	return db.Debug().Where("doctor_code=?", code).Find(d).Error
}

func (d *Doctor) FIndDoctorById(db *gorm.DB, id int64) error {
	return db.Debug().Where("id =?", id).First(d).Error
}
